//
//  UserInfoPage.swift
//  Uber
//
//  Created by 朱 桓 on 16/1/11.
//  Copyright © 2016年 zhu.huan. All rights reserved.
//

import UIKit

class UserInfoPage: ZhBasePage,UIImagePickerControllerDelegate,UINavigationControllerDelegate {

    @IBOutlet weak var backUserView: UIView!
    @IBOutlet weak var avatar: UIImageView!
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        self.title = "建立基本资料"
        
        // 圆角设置
        backUserView.layer.masksToBounds = true
        backUserView.layer.cornerRadius = 5
        
        backgroundView.layer.masksToBounds = true
        backgroundView.layer.cornerRadius = 5
        
        // 导航条设置
        setNavigationItem("back.png", selector: "doBack", isRight: false)
        setNavigationItem("下一步", selector: "doRight", isRight: true)
    }
    
    @IBAction func doSetAvatar(sender: UIButton)
    {
        let page = UIImagePickerController()
        

        page.sourceType = .PhotoLibrary
        page.delegate = self
        
        self.presentViewController(page, animated: true, completion: nil)
    }
    
    func imagePickerController(picker: UIImagePickerController, didFinishPickingImage image: UIImage, editingInfo: [String : AnyObject]?) {
        avatar.image = image
        picker.dismissViewControllerAnimated(true, completion: nil)
    }
    
    /**
    *添加支付页面
    */
    override func doRight()
    {
        let page = AddPayPage()
        
        self.navigationController?.pushViewController(page, animated: true)
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
    }

}
